package com.cloudbroker.openapi.mobile.controller;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import com.cloudbroker.bcs.platform.dav.bizapi.service.business.upvote.back.VoteRecordListBack;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.upvote.vo.RecordListForm;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.entity.HSBCPSBackNumVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.upvote.vo.ClickUpvoteForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.UpvoteT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;

@Controller
public class UpvoteController {
    @Resource
    private UpvoteT2BizService upvoteT2;
    
    /**
     * 点赞
     * */
    @ResponseBody
    @RequestMapping("/func_click_upvote")
    @SaveLog(remark = "点赞")
    public HSBCPSBackNumVO funcClickUpvote(HttpServletRequest request, String jsonpcallback) {
        ClickUpvoteForm form = getSingleParameterMapForBody(request, ClickUpvoteForm.class);
        return VOUtil.setJsonpResult(upvoteT2.funcClickUpvote(form), jsonpcallback);
    }
    /**
     * 搜索列表
     * */
    @ResponseBody
    @RequestMapping("/func_get_vote_record_list")
    @SaveLog(remark = "搜索列表")
    public VoteRecordListBack funcGetVoteRecordList(HttpServletRequest request, String jsonpcallback) {
        RecordListForm form = getSingleParameterMapForBody(request, RecordListForm.class);
        return VOUtil.setJsonpResult(upvoteT2.funcGetVoteRecordList(form), jsonpcallback);
    }

}
